package com.itlong.cloud.app.service.impl;

import com.itlong.cloud.POJO.PO.AppPublishInfoPO;
import com.itlong.cloud.app.service.IAppPublishInfoService;
import com.itlong.cloud.operate.dao.IOperateAppPublishInfoDao;
import com.itlong.cloud.thrown.DataAccessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <desc>
 *      APP端-首页版块-App版本管理服务层接口实现类
 * </desc>
 *
 * @createDate 2017/10/10
 */
@Service
public class IAppPublishInfoServiceImpl implements IAppPublishInfoService{

    @Autowired
    IOperateAppPublishInfoDao iOperateAppPublishInfoDao;


    /**
     * <desc>
     *     APP端_首页版块,获取最新版本的发布日志
     * </desc>
     * @param appType 类型,android/ios/iossdk/androidsdk/androidengineer
     * @param appSort 类别 test/official
     * @return
     * @author cuiduanwu
     * @createDate 2017/10/10
     */
    @Override
    @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
    public AppPublishInfoPO getLatestAppPublishInfo(String appType,String appSort,String appLanguage) throws Exception{
        try {
            return  iOperateAppPublishInfoDao.getLatestAppPublishInfo(appType,appSort,appLanguage);
        }catch (Exception e){
            throw new DataAccessException("【APP_首页版块】获取最新版本失败");
        }
    }

}
